Hi everyone, this is my second topic here. |
Re: Convert attribute with values to attribute with numbers I think you want an integer attr "3A1" that is also your attr DXL with the "if" statement you suggest, along with "elseif" statements for the other possibilities.
Then create another enumerated Attr-DXL in m3 with enumerations "ok" amd "not ok" and perhaps "error" and an empty enum. That code is rather trivial and ignores links:
If o3 can be linked indirectly to more than one o1. Perhaps then instead of assigning "Result = 1" you assign it to the max of Result or 1: "(Result >? 1)" or the min "(Result <? 1)" ; pre-setting Result = 0 or some very high number -Louie |
Re: Convert attribute with values to attribute with numbers llandale - Wed May 16 12:36:30 EDT 2012
Then create another enumerated Attr-DXL in m3 with enumerations "ok" amd "not ok" and perhaps "error" and an empty enum. That code is rather trivial and ignores links:
If o3 can be linked indirectly to more than one o1. Perhaps then instead of assigning "Result = 1" you assign it to the max of Result or 1: "(Result >? 1)" or the min "(Result <? 1)" ; pre-setting Result = 0 or some very high number -Louie Where do i need to paste this code? Do i need to create the text in notepad and look it up when i create the attibute (dxl attribute, browse)? Regarding the 1st code: oIn1 = find linked object in m1. Lets hope there is only one such linked object: There are a many to one; or one to one and; a one to many relation ship. Also if the module is not called 1 but FMEA, do i need to write the code like this? oInFMEA string Value = oIn1."1A2" int iResult = -1 if (Value == "word1") then iResult = 1 elseif(Value == "word2") then iResult = 2 elseiif.. else iResult = -1 obj.attrDXLName = iResult Thanks again |
Re: Convert attribute with values to attribute with numbers Manu23 - Mon May 21 04:03:24 EDT 2012 |
Re: Convert attribute with values to attribute with numbers Manu23 - Mon May 21 04:03:24 EDT 2012 "oIn1": There are quite a few folks who can keep track of 100s of details such as variable names, and don't need any sort of discipline. They could call the 1st one A, second B etc and won't get confused. I'm at the other end of the spectrum (mentally) and if I don't take time to acurately name my variables I will get hopelessly lost even in the most routine function. And, I may say, the next dude to read the function appreciates my effort. So no, you don't have to rename the attribute "oInFEMA"; however I certainly would do something like that; "oFEMA" most likely. -Louie |